package com.hgyc.mom.wms.entity;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * <p>
 * 采购明细
 * </p>
 *
 * @author fwj
 * @since 2025-05-15
 */
@Data
@TableName("scm_purchase_detail")
@Schema(name="采购明细对象", description="采购明细对象")
public class ScmPurchaseDetail implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "")
    private Long id;

    @Excel(name = "采购单ID")
    @EQ
    @Schema(description = "采购单ID")
    private Long purchaseId;

    @Excel(name = "物料ID")
    @Schema(description = "物料ID")
    @TableDict(table = "base_material", key = "id" , columns = {
            @DictColumn(name ="material_code", alias = "materialCode"),
            @DictColumn(name = "material_name", alias = "materialName")
    })
    private Long materialId;

    @Excel(name = "采购数量")
    @Schema(description = "采购数量")
    private Long qty;

    @Excel(name = "交货日期")
    @Schema(description = "交货日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate deliveryDate;

    @Excel(name = "最近交货日期")
    @Schema(description = "最近交货日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate latestDeliveryDate;

    @Excel(name = "总收货量")
    @Schema(description = "总收货量")
    private Long totalReceivedQty;

    @Excel(name = "")
    @Schema(description = "")
    private String remark;

    @Excel(name = "状态")
    @Schema(description = "状态")
    private String status;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "")
    private LocalDateTime updateTime;

}